﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using CMS.BLL;

public partial class Controls_Video_ctrVideo_Homepage : System.Web.UI.UserControl
{
    private int nCurrentLanguage = Support.GetCurrentLanguage(); 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.SetLabel();
            BindVideo();
        }
    }

    private void SetLabel()
    {
        lblTravelVideo.Text = MultipleLanguage.VIDEO[nCurrentLanguage - 1];
        lnkShowall.Text = MultipleLanguage.VIDEO_LIST[nCurrentLanguage - 1] ;
        lnkShowall.NavigateUrl = "~/Videos.aspx";
    }

    private void BindVideo()
    {
        // width="250" height="215"
        Video objVideo = new Video();
        DataTable dtbVideo = new DataTable();
        dtbVideo = objVideo.GetAll();

        int nCount = dtbVideo.Rows.Count;

        ltrVideo.Text = dtbVideo.Rows[nCount - 1]["URL"].ToString();
    }

}